﻿<UserControl
	x:Class="ICSharpCode.PackageManagement.Scripting.PackageManagementConsoleView"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:core="http://icsharpcode.net/sharpdevelop/core"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:pmd="clr-namespace:ICSharpCode.PackageManagement"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	mc:Ignorable="d" 
	d:DesignHeight="300"
	d:DesignWidth="500">

	<UserControl.Resources>
		<pmd:PackageManagementViewModels x:Key="ViewModels"/>
		
		<DataTemplate x:Key="PackageSourceTemplate">
			<TextBlock Text="{Binding Name}"/>
		</DataTemplate>
	
		<DataTemplate x:Key="ProjectTemplate">
			<TextBlock Text="{Binding Name}"/>
		</DataTemplate>
	
	</UserControl.Resources>

	<UserControl.DataContext>
		<Binding Path="PackageManagementConsoleViewModel" Source="{StaticResource ViewModels}"/>
	</UserControl.DataContext>
	
	<Grid>        
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>

		<ToolBar>
			<TextBlock
				Margin="4"
				Text="Package Source:"/>

			<ComboBox
				Grid.Column="1"
				MinWidth="200"
				SelectedItem="{Binding Path=ActivePackageSource}"
				ItemTemplate="{StaticResource PackageSourceTemplate}"
				ItemsSource="{Binding Path=PackageSources}"/>

			<TextBlock
				Grid.Column="2"
				Margin="4"
				Text="Default Project:"/>

			<ComboBox
				Grid.Column="3"
				MinWidth="200"
				SelectedItem="{Binding Path=DefaultProject}"
				ItemTemplate="{StaticResource ProjectTemplate}"
				ItemsSource="{Binding Path=Projects}"/>
		
			<Button
				Grid.Column="4"
				ToolTip="{core:Localize MainWindow.Windows.CompilerMessageView.ClearAllButton.ToolTip}"
				Command="{Binding Path=ClearConsoleCommand}">
				<Image
					Source="{core:GetBitmap OutputPad.Toolbar.ClearOutputWindow}"
					Height="16"
					Width="16"/>
			</Button>
		</ToolBar>
		
		<ContentControl
			Grid.Row="1"
			Margin="4, 0"
			Content="{Binding Path=TextEditor}"/>
	</Grid>
</UserControl>